Page 5 of 5 FirstFirst ... 345
Results 41 to 48 of 48

Thread: Purple Elephants Eventhandler

  1. #41
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Strange, the version i have does use level.mine_run...

    Anyway i cleaned up my code abit, so its a bit easier for me to read it again.

    Here is the global/mines/main.scr
    /*
    Mine Mod V1
    16th June 2013
    
    Adds 3 types of mines to the game
    1. Proximity Mine
    2. StickyBomb
    3. C4
    
    All in the grenade weaponslot , can be used alongside normal grenades
    
    Requires Reborn Patch 1.12 >>> www.x-null.net
    
    
    Place
    -------------------------------
    exec global/mines/main.scr::main
    -------------------------------
    In global/dmprecache.scr
    
    ----- Suggested to Also download my EventHandler for reborn events ----------------
    
    If you are NOT using my eventhandler, this will use the spawn event
    -------------------------------------------
    
    Mine Usage:
    ------------
    Select Mines ( use weaponclass grenade ) or scroll weapons until you get them
    Press [Fire] to place a mine,
    When a player steps on the mine , it will explode. Can have multiple mines out on the battlefield at one time
    
    Stickybomb Usage:
    -----------------
    Select Stickybomb ( use weaponclass grenade ) or scroll weapons until you get them
    Time Delay --- Players can choose what time they want the stickybomb to go off at
    Press [Secondary Fire] to toggle between times ( displayed bottom right ) Min = 5 seconds , Max = 30 seconds , Times goes up by 5 each time.
    Press [Fire] to throw the Stickybomb
    Once Timer has been reached , Stickybomb will explode
    OR
    If the Stickybomb is Shot , it will explode immediately
    Note: It will remember your last timedelay setting , until you die that is
    
    C4 Usage:
    ---------
    Select C4 ( use weaponclass grenade ) or scroll weapons until you get them
    Press [Fire] to throw the C4
    Press [Secondary Fire] to Set off the C$
    Once Trigger has been pushed , C4 will explode
    OR
    If the C4 is Shot , it will explode immediately
    
    CVARS
    ------
    set pe_mine_mod 1        // On of Off
    set pe_mine_instructions // On or Off === Displays instructions on how to use each weapon as they select them
    
    set pe_mine 1          // On of Off
    set pe_mine_amount #      // Number of Mines available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines )
    
    set pe_stickybomb 1     // On of Off
    set pe_sticky_amount #  // Number of Stickybombs available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines )
    
    set pe_c4 1             // On or Off
    set pe_c4_amount #        // Number of C4available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines )
    
    
    Example Config:
    ------------------------------
    set pe_mine_mod "1"
    set pe_mine_instructions "1"
    
    set pe_mine 1
    set pe_stickybomb_amount 4
    set pe_c4 0
    
    ------------------------------
    
    Conflicts
    ----------
    Uses ihuddraws indexs 100 - 131 , depending on settings above
    
    
    Credits
    --------
    Proximity Mine - Elgan & ArMaGedDoN
    StickyBomb         - Elgan
    C4                - Elgan && PurpleElephant
    
    Weapon.tiks     - PurpleElephant
    
    Mod by PurpleElephant
    
    */
    //////////////////////////////////////////////////////////////////////////////////////////////
    main:
    
    if(level.mine_run)
    end
    
    level.mine_run = 1
    
    if(getcvar(pe_mine_mod) != "1")
    end
    
    //// Spawn event register
    if(level.eventhandler_run == 1)
    {
        waitexec global/eventhandler.scr::register spawn global/mines/main.scr::spawn
    }
    else
    {
        local.result = registerev "spawn" global/mines/main.scr::spawn
    }
    
    
    end
    
    get_cvars:
    
    level.mine_instructions = int(getcvar(pe_mine_instructions))
    
    level.pe_mines = getcvar(pe_mine)
    level.pe_mine_amount = int(getcvar(pe_mine_amount))
    level.pe_c4 = getcvar(pe_c4)
    level.pe_c4_amount = int(getcvar(pe_c4_amount))
    level.pe_stickybomb = getcvar(pe_stickybomb)
    level.pe_stickybomb_amount = int(getcvar(pe_stickybomb_amount))
    
    end
    
    spawn local.player:
    
    if(local.run)
    end
    
    local.run = 1
    
    /// Removes attached model, if any
    if($("mdlattach" + local.player.entnum) != NULL)
    $("mdlattach" + local.player.entnum) remove
    
    waitthread get_cvars;
    
    //////////////////////////////////////////////////////////
    if(level.pe_mines == "1")
    {
        local.player give "models/weapons/mine.tik"
    
        local.player.minelimit = int(level.pe_mine_amount)
        if(local.player.minelimit == 0)
        local.player.minelimit = int(3)
    
        local.player.startmine = local.player.minelimit
        local.player.placed_mine = 0
    }
    ////////////////////////////////////////////////////////////
    if(level.pe_c4 == "1")
    {
        local.player give "models/weapons/c4.tik"
    
        local.player.c4limit = int(level.pe_c4_amount)
        if(local.player.c4limit == 0)
        local.player.c4limit = int(3)
    
        local.player.startc4 = local.player.c4limit
        local.player.placed_c4 = 0
    }
    //////////////////////////////////////////////////////////////
    if(level.pe_stickybomb == "1")
    {
        local.player give "models/weapons/stickybomb.tik"
    
        local.player.stickylimit = int(level.pe_stickybomb_amount)
        if(local.player.stickylimit == 0)
        local.player.stickylimit = int(3)
    
    
        local.player.startsticky = local.player.stickylimit
        local.player.placed_sticky = 0
    }
    /////////////////////////////////////////////////////////////
    
    while(local.player != NULL && local.player != NIL && isAlive(local.player) && local.player.dmteam != spectator && local.player.mef_spectator != 1)
    {
    
            if(!local.player)
            end
    
            if(local.player == NULL)
            end
    
            waitthread getWeapon local.player
    
            wait 0.2
            if(local.player.weapon == "models/weapons/mine.tik")
                thread hasMine local.player
    
            if(local.player.weapon == "models/weapons/c4.tik")
                thread hasC4 local.player
    
            if(local.player.weapon == "models/weapons/stickybomb.tik")
                thread hasSticky local.player
    
            if(local.player.weapon != "models/weapons/stickybomb.tik")
            {
                local.player.has_stickyinhand = 0
                thread huds_off local.player sticky
    
                if(local.player.stickylimit <= 0 )
                local.player take "models/weapons/stickybomb.tik"
            }
            ///////////////////////////////////////////////////////////////
            if(local.player.weapon != "models/weapons/mine.tik")
            {
                local.player.has_mineinhand = 0
                thread huds_off local.player mine
    
                if(local.player.minelimit <= 0 )
                local.player take "models/weapons/mine.tik"
            }
            //////////////////////////////////////////////////////////////////
            if(local.player.weapon != "models/weapons/c4.tik")
            {
                local.player.has_c4inhand = 0
                thread huds_off local.player c4
            }
            if(local.player.c4limit <= 0 && local.player.placed_c4 != 1)
            local.player take "models/weapons/c4.tik"
    
    
    
    waitframe
    
    }
    
    wait 4
    
    local.run = 0
    
    end
    
    getWeapon local.player:
    
        local.player weaponcommand dual targetname ("weap" + local.player.entnum )
        local.weapon = $("weap" + local.player.entnum )
    
        if(local.weapon != NULL)
            {
            local.player.weapon = local.weapon.model
            local.weapon targetname ""
            }
            else
            {
                local.player.weapon = "models/weapons/unarmed.tik"
            }
    end
    hasMine local.player:
    
    if(local.player.has_mineinhand != 1)
    {
        local.player attachmodel "items/explosive.tik" "tag_weapon_right" 1.0 ("mdlattach" + local.player.entnum) 1 -1 -1 -1 -1 ( 0 0 0 )
        waitthread mine_huds local.player
        local.player.has_mineinhand = 1
        local.player thread instructions mine
    }
    
    if(local.player.fireheld && local.player.minelimit > 0 && local.player.placed_mine != 1)
    {
        local.player.placed_mine = 1
        local.player stufftext ("subtitle3 Using-Mine")
        local.player exec global/mines/mines_main.scr
        local.player.minelimit--
        waitthread mine_huds local.player
    }
    end
    
    hasC4 local.player:
    if(local.player.has_c4inhand != 1)
    {
        local.player attachmodel "items/explosive2.tik" "tag_weapon_right" 1.0 ("mdlattach" + local.player.entnum) 1 -1 -1 -1 -1 ( 0 0 0 )
        waitthread c4_huds local.player
        local.player.has_c4inhand = 1
        local.player thread instructions c4
    }
    if(local.player.fireheld && local.player.c4limit > 0 && local.player.placed_c4 != 1)
    {
        local.player.placed_c4 = 1
        local.player stufftext ("subtitle3 Using-C4")
        local.player exec global/mines/c4_main.scr
        local.player.c4limit--
        waitthread c4_huds local.player
    }
    end
    
    hasSticky local.player:
    
    if(local.laststickywait == NIL)
    local.stickywait = 5
    
    if(local.laststickywait != NIL)
    local.stickwyait = local.laststickywait
    
    wait 0.2
    
    if(local.player.has_stickyinhand != 1)
    {
        local.player attachmodel "items/explosive2.tik" "tag_weapon_right" 2.0 ("mdlattach" + local.player.entnum) 1 -1 -1 -1 -1 ( 0 0 0 )
        waitthread sticky_huds local.player local.stickywait
        local.player.has_stickyinhand = 1
        local.player thread instructions stickybomb
    }
    
    while(local.player.secfireheld)
    {
        wait 0.5
        local.stickywait += 5
    
        if(local.stickywait > 31)
        local.stickywait = 5
    
        waitthread sticky_huds local.player local.stickywait
        local.laststickywait = local.stickywait
        wait 0.5
    }
    
    if(local.player.fireheld && local.player.stickylimit > 0 && local.player.placed_sticky != 1)
    {
        local.player.placed_sticky = 1
        local.player stufftext ("subtitle3 Using-Stickybomb")
        local.player exec global/mines/stickybombs_main.scr local.stickywait
        local.player.stickylimit--
        waitthread sticky_huds local.player local.stickywait
    }
    
    end
    
    ////////////////////////////////////////////////////////////////
    /*
     _____           _                   _   _
    |_   _|         | |                 | | (_)
      | |  _ __  ___| |_ _ __ _   _  ___| |_ _  ___  _ __  ___
      | | | '_ \/ __| __| '__| | | |/ __| __| |/ _ \| '_ \/ __|
     _| |_| | | \__ \ |_| |  | |_| | (__| |_| | (_) | | | \__ \
    |_____|_| |_|___/\__|_|   \__,_|\___|\__|_|\___/|_| |_|___/
    */
    //////////////////////////////////////////////////////////////
    instructions local.model:
    
    local.player = self
    
    if(local.player == NULL)
    end
    
    if(level.mine_instructions != 1)
    end
    
    switch(local.model){
    
    case "mine":
    if(local.player.mine_instructed != 1)
    {
    local.player.mine_instructed = 1
    local.player iprint "Press [Fire] to place a Mine"
    waitframe
    local.player iprint "Once Stepped on by enemy, it will detonate"
    waitframe
    local.player iprint "Mine Lights up for 2 seconds if you step on it"
    wait 30
    local.player.mine_instructed = 0
    }
    break
    
    case "c4":
    if(local.player.c4_instructed != 1)
    {
    local.player.c4_instructed = 1
    local.player iprint "Press [Fire] to place C4"
    waitframe
    local.player iprint "Press [SecondaryFire] while holding Trigger in hand to detonate"
    wait 30
    local.player.c4_instructed = 0
    }
    break
    
    case "stickybomb":
    if(local.player.stickybomb_instructed != 1)
    {
    local.player.stickybomb_instructed = 1
    local.player iprint "Hold [SecondaryFire] to adjust Timer on Stickybomb"
    waitframe
    local.player iprint "Minimum Time is 5 secs, Maximum is 30 secs"
    waitframe
    local.player iprint "Press [Fire] to Throw the Stickybomb"
    wait 30
    local.player.stickybomb_instructed = 0
    }
    break
    
    default:
    }
    
    end
    ///////////////////////////////////////////////////
    /*
     _    _ _    _ _____   _____
    | |  | | |  | |  __ \ / ____|
    | |__| | |  | | |  | | (___
    |  __  | |  | | |  | |\___ \
    | |  | | |__| | |__| |____) |
    |_|  |_|\____/|_____/|_____/
    
    */
    /////////////////////////////////////////////////
    huds_off local.player local.model:
    
    switch(local.model){
    
    case "mine":
    ihuddraw_alpha local.player 100 0
    for(local.i = 1; local.i <= local.player.startmine; local.i++)
        {
        local.index = (local.i + 100)
        ihuddraw_alpha local.player local.index 0
        }
    break
    
    case "c4":
    ihuddraw_alpha local.player 111 0
    ihuddraw_alpha local.player 112 0
    for(local.i = 1; local.i <= local.player.startc4; local.i++)
        {
        local.index = (local.i + 112)
        ihuddraw_alpha local.player local.index 0
        }
    break
    
    case "sticky":
    ihuddraw_alpha local.player 122 0
    ihuddraw_alpha local.player 123 0
    for(local.i = 1; local.i <= local.player.startsticky; local.i++)
        {
        local.index = (local.i + 123)
        ihuddraw_alpha local.player local.index 0
        }
    break
    
    default:
    }
    
    end
    /////////////////////////////////////////////////////////////////////
    mine_huds local.player:
    
    local.starty = 470
    local.mineshader = "textures/hud/item_explosive"
    
    for(local.i = 1; local.i <= local.player.minelimit; local.i++)
        {
        local.posy = (local.starty - (local.i * 20))
        local.index = (local.i + 100)
        ihuddraw_virtualsize local.player local.index 1
        ihuddraw_align local.player local.index right top
        ihuddraw_font local.player local.index "verdana-12"
        ihuddraw_rect local.player local.index -30 local.posy 25 25
        ihuddraw_color local.player local.index 1 0 1
        ihuddraw_alpha local.player local.index 1
        ihuddraw_shader local.player local.index local.mineshader
        }
    
    ihuddraw_virtualsize local.player  100 1
    ihuddraw_align local.player   100 right top
    ihuddraw_font local.player    100 "verdana-12"
    ihuddraw_font local.player    100 ""
    ihuddraw_rect local.player    100 -45 460 20 20
    ihuddraw_color local.player 100 1 0.85 0
    ihuddraw_alpha local.player   100 1
    ihuddraw_string local.player   100 (local.player.minelimit)
    
    end
    //////////////////////////////////////////////////////////////////////
    c4_huds local.player:
    
    local.starty = 470
    local.c4str = "Press [Secondary Fire] to set off"
    local.c4shader = "textures/hud/item_radio_explosive.tga"
    
    for(local.i = 1; local.i <= local.player.c4limit; local.i++)
        {
        local.posy = (local.starty - (local.i * 20))
        local.index = (local.i + 112)
        ihuddraw_virtualsize local.player local.index 1
        ihuddraw_align local.player local.index right top
        ihuddraw_font local.player local.index "verdana-12"
        ihuddraw_rect local.player local.index -30 local.posy 25 25
        ihuddraw_color local.player local.index 1 0 1
        ihuddraw_alpha local.player local.index 1
        ihuddraw_shader local.player local.index local.c4shader
        }
    
    ihuddraw_virtualsize local.player  111 1
    ihuddraw_align local.player   111 right top
    ihuddraw_font local.player    111 "verdana-12"
    ihuddraw_rect local.player    111 -45 460 20 20
    ihuddraw_color local.player 111 1 0.75 0
    ihuddraw_alpha local.player   111 1
    ihuddraw_string local.player   111 (local.player.c4limit)
    
    ihuddraw_virtualsize local.player  112 1
    ihuddraw_align local.player   112 right top
    ihuddraw_font local.player    112 "verdana-12"
    ihuddraw_rect local.player    112 -180 440 20 20
    ihuddraw_color local.player 112 1 0.75 0
    ihuddraw_alpha local.player   112 1
    ihuddraw_string local.player   112 (local.c4str)
    
    end
    ///////////////////////////////////////////////////////////////////////////////////
    sticky_huds local.player local.stickywait:
    
    local.starty = 470
    local.stickybombstr = "Stickybomb Delay = "
    local.stickyshader = "textures/hud/item_radio_explosive.tga"
    
    for(local.i = 1; local.i <= local.player.stickylimit; local.i++)
        {
        local.posy = (local.starty - (local.i * 20))
        local.index = (local.i + 123)
        ihuddraw_virtualsize local.player local.index 1
        ihuddraw_align local.player local.index right top
        ihuddraw_font local.player local.index "verdana-12"
        ihuddraw_rect local.player local.index -30 local.posy 25 25
        ihuddraw_color local.player local.index 1 0 1
        ihuddraw_alpha local.player local.index 1
        ihuddraw_shader local.player local.index local.stickyshader
        }
    
    ihuddraw_virtualsize local.player  122 1
    ihuddraw_align local.player   122 right top
    ihuddraw_font local.player    122 "verdana-12"
    ihuddraw_rect local.player    122 -45 460 20 20
    ihuddraw_color local.player 122 1 0.75 0
    ihuddraw_alpha local.player   122 1
    ihuddraw_string local.player   122 (local.player.stickylimit)
    
    ihuddraw_virtualsize local.player  123 1
    ihuddraw_align local.player   123 right top
    ihuddraw_font local.player    123 "verdana-12"
    ihuddraw_rect local.player    123 -150 440 20 20
    ihuddraw_color local.player 123 1 0.75 0
    ihuddraw_alpha local.player   123 1
    ihuddraw_string local.player   123 (local.stickybombstr + local.stickywait)
    
    end


    Make sure the cvars are set in server.cfg or similar and double check it loads, you should see it under the spawn event section in the eventhandler feedback.



    Looking over it i need to update it soon to use just the 1 cvar per mine, same as i did for the weapons, instead of 2, i could either split the incoming cvar into ON/OFF and AMMO, or just have if AMMO > 1 then turn on... something like that.
    Also want to see if its possible to have more then one C4 or StickyBomb active at a time, because ATM it wont allow it. and maybe make it toggleable to see if mines can be shot like the others.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  2. #42
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Also for the weapon swap key problem, it doesnt like it when the cvar is not set, but heres the fixed part of that.

    Code:
    if(int(getcvar(pe_weapon_swap)) == 1)
    {
    
        if(level.weapon_swap_key == "")
        {
            level.weapon_swap_key = "i"
            setcvar "pe_weapon_swap_key" "i"
        }
    
        local.str = "bind " + level.weapon_swap_key + " keyp 42";
        local.player stufftext (local.str);
    }

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #43
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    Have the exact same issue still after replacing my main.scr with the one you listed above :\

    Here's a tail of my dmprecache.scr (and note that global/events/*/. are all empty:
    //NEW09.08
    cache models/fx/nebelhandgranateexplosion.tik

    exec global/eventhandler.scr
    exec global/weapons.scr::main
    exec global/mines/main.scr::main


    and this is the eventhandler feedback after startup, you can tell it's not loading the mod...:
    Code:
    ------ Server Initialization Complete ------  1.36 seconds
    soundtrack switched to music/mohdm1.mus.
    playing music/mohdm1.mus
    music set to normal with fallback normal
    Loading Ambient.scr
    Hitch warning: 1409 msec frame time
    EventHandler Results
    
    ~~~~~~~~~~~~~~~~~ Event Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    
    ~~~~Successful Registered Events~~~~
    
    Spawn || Connected ||  Disconnected ||  Intermission ||  Damage ||  Kill Event || Keypress || Servercommand
    
    ~~~~Already Registered Events~~~~
    
    None
    
    ~~~~Unsuccessful Registered Events~~~~
    
    None
    
    ~~~~Events Not Called~~~~
    
    None
    
    ~~~~~~~~~~~~~~~~~ End Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    
    ~~~~~~~~~~~~~ Advanced Event Handler FeedBack ~~~~~~~~~~~~~~~~
    
    ~~~~Spawn Events~~~~
    
    global/weapons.scr::spawn || 
    
    ~~~~Connection Events~~~~
    
    None
    
    ~~~~Disconnected Events~~~~
    
    None
    
    ~~~~Intermission Events~~~~
    
    None
    
    ~~~~Damage Events~~~~
    
    None
    
    ~~~~Kill Events~~~~
    
    None
    
    ~~~~Keypress Events~~~~
    
    global/weapons.scr::swap || 
    
    ~~~~Servercommand Events~~~~
    
    None
    
    ~~~~Duplicates Errors ~~~~
    
    None
    
    ~~~~~~~~~~~~~ End Advanced FeedBack ~~~~~~~~~~~~~~~~
    But - I have timelimit set to 1, and after the above first map ends due to 1 minute passing, see the following output:
    Code:
    SV_GameMap(obj/obj_team1)
    ------ Server Initialization ------
    Server: obj/obj_team1
    
    
    ------------------ MoH:AA 1.12 Reborn Patch Shutdown ------------------ 
    Shared settings memory deinitialized correctly.
    LocalizationError removal fix shutdown.
    BulletAttack: Unhooked correctly.
    Anti Wallhack/Visuals protection shutdown
    UserInfo DirectConnect Protection shutdown
    UserInfo Buffer overflow protection shutdown
    Player::PreviousWeapon Infinite Loop Crash Protection shutdown
    Player::NextWeapon Infinite Loop Crash Protection shutdown
    Kick/Ban Announcements Deinitialized
    ScriptedEvents System Deinitialized
    Internal Packet Flood Protection Deinitialized
    SignalHandlers Deinitialized
    ----------------- MoH:AA 1.12 Reborn Patch ShutdownEnd ---------------- 
    
    
    ==== ShutdownGame ====
    ------ Unloading fgameded.so ------
    ------- Attempting to load ./fgameded.so -------
    LoadLibrary (fgameded.so)
    
    
    ------------------ MoH:AA 1.12 Reborn Patch InitGame ------------------ 
    Initializing SignalHandlers. Done!
    Initializing CVARS. Done!
    Performing game and patch files integrity check...
    --> MoHAA Server Hash: 6d8c51fa1a3a7b3d392348dd6cb2e4c5
    --> Fgameded Hash:     a08070c65b6994312a2218f79174245d
    --> mohaa_lnxded file valid!
    --> fgamededmohaa.so file valid!
    --> Next update check will be performed after 22 hours (0 day/s)!
    Initializing Chat Filter. Done!
    Initializing Banned Names List. Done!
    Initializing Banned IPs List. Done!
    Initializing Allowed Votes List. Done!
    Initializing Allowed Maps List. Done!
    Initializing Admins List. Done!
    Initializing Protected Names List. Done!
    Reborn.map mapped into address space. Shared settings initialized!
    LocalizationError fix Address: 0x080ADE9E
    LocalizationError removal fix applied.
    BulletAttack Address: 0x369c990
    GetMuzzlePosition Address: 0x368dbe0
    GetEntityTag Address: 0x35cf990
    Player::Respawn Address: 0x361bcb0
    Player::Killed Address: 0x361be60
    Entity::Damage Address: 0x35ccaf0
    Player::JumpXY Address: 0x36206d0
    BulletAttack: Hooked correctly.
    Anti Wallhack/Visuals Protection applied
    Black Window Patch Address: 0x369d16a
    Shoot through Black Window/Furniture/Light Bulbs Hack Protection applied
    RConFlood Patch Address: 0x808ce4f
    RConFlood Crash Protection applied
    InfoBoom Patch Address: 0x807930b & 0x8079296
    InfoBoom Crash Protection applied
    SV_UpdateUserinfo_f Address: 0x8087c00
    UserInfo Buffer overflow protection applied (512 chars limit)
    UserInfo DirectConnect Protection applied
    Player::PreviousWeapon Infinite Loop Crash Protection applied
    Player::NextWeapon Infinite Loop Crash Protection applied
    ScriptedEvents System Initialized
    Kick/Ban Announcements Initialized
    Internal Packet Flood Protection Initialized
    Allowed remote tool IP: 127.0.0.1 (7f000001)
    ---------------- MoH:AA 1.12 Reborn Patch InitFinished ----------------
    
    
    ==== InitGame ====
    sizeof(Actor) == 2960
    Magic sizeof actor numer: 2896
    
    ------------------
    Event system initialized: 154 classes 1390 events 856240 total memory in response list
    
    ==== CleanupGame ====
    CM_LoadMap( maps/obj/obj_team1.bsp, 0 )
    ^~^~^ Can't find textures/interior/hearthsides.tga
    ^~^~^ Can't find textures/interior/hearth_set1baseF.tga
    ^~^~^ Can't find textures/interior/whitewoodbmtrm.tga
    ^~^~^ Can't find textures/interior/panel_set2.tga
    Loading Reborn Loader...
    Adding script: 'obj/obj_team1_precache.scr'
    ^~^~^ Can't find models/weapons/enfield.tik
    Tiki:LoadFile Couldn't load models/weapons/enfield.tik
    ^~^~^ Can't find models/weapons/fg42.tik
         (lots and lots of Tiki:LoadFile Couldn't load whatever messages)
    Tiki:LoadFile Couldn't load models/fx/nebelhandgranateexplosion.tik
    Calling Event Handler
    -------------------- Spawning Entities -----------------------
    soundtrack switched to .
    -------------------- Actual Spawning Entities -----------------------
    -------------------- Actual Spawning Entities Done ------------------ 1 ms
    0 teams with 0 entities
    Adding script: 'obj/obj_team1.scr'
    ^~^~^ Can't find models/weapons/enfield.tik
    Tiki:LoadFile Couldn't load models/weapons/enfield.tik
      (lots and lots more Tiki:LoadFile Couldn't load whatever messages)
    Tiki:LoadFile Couldn't load models/fx/nebelhandgranateexplosion.tik
    Adding autosave names
    21 entities spawned
    58 simple entities spawned
    0 entities inhibited
    -------------------- Spawning Entities Done ------------------ 30 ms
    
    
    -----------PARSING UBERSOUND (SERVER)------------
    Any SetCurrentTiki errors means that tiki wasn't prefetched and tiki-specific sounds for it won't work. To fix prefetch the tiki. Ignore if you don't use that tiki on this level.
    CG_Command_ProcessFile: ubersound/ubersound.scr
    Parse/Load time: 0.025000 seconds.
    -------------UBERSOUND DONE (SERVER)---------------
    
    
    
    -----------PARSING UBERDIALOG (SERVER)------------
    Any SetCurrentTiki errors means that tiki wasn't prefetched and tiki-specific sounds for it won't work. To fix prefetch the tiki. Ignore if you don't use that tiki on this level.
    CG_Command_ProcessFile: ubersound/uberdialog.scr
    Parse/Load time: 0.124000 seconds.
    -------------UBERDIALOG DONE (SERVER)---------------
    
    ------ Server Initialization Complete ------  0.92 seconds
    soundtrack switched to music/obj_team1.mus.
    playing music/obj_team1.mus
    music set to normal with fallback normal
    Loading Ambient.scr
    Hitch warning: 969 msec frame time
    EventHandler Results
    
    ~~~~~~~~~~~~~~~~~ Event Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    
    ~~~~Successful Registered Events~~~~
    
    Spawn || Connected ||  Disconnected ||  Intermission ||  Damage ||  Kill Event || Keypress || Servercommand
    
    ~~~~Already Registered Events~~~~
    
    None
    
    ~~~~Unsuccessful Registered Events~~~~
    
    None
    
    ~~~~Events Not Called~~~~
    
    None
    
    ~~~~~~~~~~~~~~~~~ End Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    
    ~~~~~~~~~~~~~ Advanced Event Handler FeedBack ~~~~~~~~~~~~~~~~
    
    ~~~~Spawn Events~~~~
    
    global/weapons.scr::spawn || global/mines/main.scr::spawn || 
    
    ~~~~Connection Events~~~~
    
    None
    
    ~~~~Disconnected Events~~~~
    
    None
    
    ~~~~Intermission Events~~~~
    
    None
    
    ~~~~Damage Events~~~~
    
    None
    
    ~~~~Kill Events~~~~
    
    None
    
    ~~~~Keypress Events~~~~
    
    global/weapons.scr::swap || 
    
    ~~~~Servercommand Events~~~~
    
    None
    
    ~~~~Duplicates Errors ~~~~
    
    None
    
    ~~~~~~~~~~~~~ End Advanced FeedBack ~~~~~~~~~~~~~~~~
    And here is the relevant portion of my server.cfg:
    Code:
    // Mine Mod (note: amount vars combined cant be > 8 unless you adjust the hud)
    
    ////////////////////////////////////////////////////////////
    set pe_mine_mod 1
    set pe_mine_instructions 1 // Show instructions when mines selected
    
    // Mines
    set pe_mines 1   // Purple Edited ~~~ EDIT:: <<<< should be pe_mine 1
    set pe_mine_amount 2
    
    // Stickybombs
    set pe_stickybomb 1
    set pe_sticky_amount 2
    
    // C4
    set pe_c4 1
    set pe_c4_amount 2
    
    
    // Weapons Mod
    ////////////////////////////////////////////////////////////
    // Syntax:
    // set pe_weapon 1_2_3
    // 1 = On or off   0 or 1
    // 2 = Clipsize
    // 3 = Starting Amount
    //
    set pe_pistol "1_8_16"
    set pe_rifle "1_5_55"
    set pe_sniper "1_5_47"
    set pe_smg "1_20_140"
    set pe_mg "1_30_180"
    set pe_shotgun "1_5_35"
    
    // Note: Grenades and Rockets DO NOT use the clipsize amount, so...
    // set pe_grenade 1_2
    // 1 for ON
    // 2 for Amount of grenades
    //
    set pe_grenade "1_2"
    set pe_rocket "1_6"
    
    // Overrides
    set ckr_realism "0" // 1 overrides clipsize, dmammo, etc.
    set pe_allweapons 3 // 1=All, 2=All Team, 3=Allowed Team, 4=Allowed All
    
    // If weapon chosen that is turned off...
    set pe_weapon_message "1" // Show list of allowed weapons
    set pe_weapon_choice "1"  // Choose and respawn, or force to sniper
    
    // Swapping with other teams weapon
    set pe_weapon_swap "1"           // Allow swaps
    set pe_weapon_swap_time = "10"   // Minimum seconds between swaps
    set pe_weapon_swap_key = "i"     // Key to swap
    So I'm still befuddled :\
    Last edited by Purple Elephant1au; January 23rd, 2017 at 08:37 PM. Reason: Added CODE Tags

  4. #44
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    You might need a level waittill spawn before you execute the mods,

    So in dmprecache.scr
    Add
    level waittill spawn


    Also the cvar is singular for mine mod.
    set pe_mine 1, not pe_mines


    It could also be that the server is loading the mine mod before it has loaded all the server.cfg with the cvars set, which is why its not loading until the next round, so try placing the pe_mine_mod cvar at the top of your server.cfg. Or just add a wait within the mine mod for a few seconds and see if that helps.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #45
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    Purple - BINGO. You got it!

    I monkey'd around with different placements of "level waittill spawn" within DMprecache.scr. It made no difference at all.

    I copied the "set pe_mine_mod 1" to the first line of my server.cfg, and voila. The mine mod loads correctly every time. Also, thanks for catching the "pluralbug", I was wondering why no proximity mines

    Thanks so very much for your time and effort to help. These are very well done mods and I sure wanted to run these particular ones.

    You mention above about changing your mine mod to use single cvars in the same style as the weapons mod (ie = "onoff_ammo") or possibly doing it just with one parameter (dropping the on/off and assume ammo > 1 is on). I humbly request to do it the same as the weapon mod (ie. don't drop the on/off). If you drop the on/off, when I want to turn it off I have to replace ammo with 0. Then when I go back I'd never remember what I had it set to unless I copy and comment the line. Trivial thing... but I think "more obvious" is better than "less obvious".

    I had never considered that the config parse thread might not get done before an exec. I totally understand what you're saying about the different solutions (level waittill spawn, moving the config file order, or a wait in the mod). However, this would seem to me to be kind of a random fix that may not always work correctly based on independent thread execution times, etc. I'm not sure what the best solution would be.. how do I know that other mods arent randomly losing cvars based on varying execution times and external loads.

    The only way I can think of is to set a standard that the last line of a server.cfg file should always have a flag (set configdone = 1). Then every mod that gets installed (gets exec'd from dmprecache) should loop (wait until configdone = 1). I'm trying to understand the exact startup sequence/process through to accepting connections and don't think I grok all of it. I'll do some reading/research.

    Lastly - about that "level waittill spawn".... isn't global/dmprecache.scr executed by each map script and not at the beginning of the server start? I see map scripts calling global/dmprecache.scr... and then further down sometimes having 'level waittill prespawn" and always further down still having "level waittill spawn". So wouldn't putting a "level waittill spawn" inside dmprecache.scr screw up the sequence that a map script is trying to enforce? Again, I feel I'm missing some understanding there....

    Thanks for all your sage advice!

  6. #46
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Quote Originally Posted by JayWest1024 View Post
    You mention above about changing your mine mod to use single cvars in the same style as the weapons mod (ie = "onoff_ammo") or possibly doing it just with one parameter (dropping the on/off and assume ammo > 1 is on). I humbly request to do it the same as the weapon mod (ie. don't drop the on/off). If you drop the on/off, when I want to turn it off I have to replace ammo with 0. Then when I go back I'd never remember what I had it set to unless I copy and comment the line. Trivial thing... but I think "more obvious" is better than "less obvious".
    I was thinking making it similar to the weapon mod, but i am also thinking of changing the way the weapon mod cvars work anyway, allowing as you said more variables besides clipsize and ammo to be adjusted via cvar. I was thinking of implementing the same way mefy did the settings for ftag etc, so you dnt have to set every variable but you can if you choose to. Example:
    pe_sniper "allowed:1 ammo:50 clipsize:10 damage:100 runspeed:1.0"
    pe_smg "allowed:0 ammo:500 clipsize:40"
    Where settings if default to stock if not set.

    Quote Originally Posted by JayWest1024 View Post
    The only way I can think of is to set a standard that the last line of a server.cfg file should always have a flag (set configdone = 1). Then every mod that gets installed (gets exec'd from dmprecache) should loop (wait until configdone = 1).
    I was thinking the same thing, at the start of the server.cfg , set configdone cvar to 0, at the end of server.cfg set to 1.
    You would not have to add a loop on every mod, just on the dmprecache.scr itself before you execute the mods.
    Like so
    while(getcvar(configdone) != "1"))
    waitframe

    But this *might* cause mods to not startup straight away depending on the size of the server.cfg.
    I always keep custom cvars ( ie ones for mods) in a separate cfg file and execute it from the start of the server.cfg. That way i know where to change settings for mods easily and do not have to search through the server.cfg for the cvars to change.

    Quote Originally Posted by JayWest1024 View Post
    Lastly - about that "level waittill spawn".... isn't global/dmprecache.scr executed by each map script and not at the beginning of the server start? I see map scripts calling global/dmprecache.scr... and then further down sometimes having 'level waittill prespawn" and always further down still having "level waittill spawn". So wouldn't putting a "level waittill spawn" inside dmprecache.scr screw up the sequence that a map script is trying to enforce? Again, I feel I'm missing some understanding there....
    Yes dmprecache.scr is executed by every map script, normally after the level waittill prespawn, but before the level waittill spawn, so you should be able to include a waittill spawn inside the dmprecache.scr, most of my mods i use like that.
    I have not seen many map scripts that have dmprecache.scr after waittill spawn, but maybe on some custom maps....but yea most of the time if the game sees something like that, it reports it as a script error in the log saying something like
    invalid level waittil spawn
    or similar.

    Alot depends on the server itself, how many cvars and mods are running on the game, and how many people are playing, all of these can effect the time it takes to load everything, so it is hard to make a fix that would best suit everyone, because one server it might help, another one it might slow the startup of the mods...

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  7. #47
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    weapon/mine cvars:
    Perfect, that's what I was hoping for. Important variables to me for that are dmcrosshair and zoom as well as the usual culprits you mention. As you can probably tell where I'm heading, I want to use this along with the mefy gametype mod where there is a syntax to set cvars on a per map basis. This would allow me to not only set weapons available, weapon characteristics (without my admins having to edit .tik files), walk/run speeds, whether its FT or OBJ or TDM, and other parameters *all on a map by map basis*. So you're looking to adopt the mefy per map syntax for your cvars (great idea), and I'm then wanting to put your cvars inside mefy's "per map cvar settings" syntax

    I'm also pondering a way to have maplist (well, actually extmaplist) have a sense of time. In other words, from 6am to 9pm use extmaplist A, but from 9pm to 5am use extmaplist B, etc. Yes, you can automate this with cron and rename config files and restart the server... but that seems... less elegant. Plus if players are on it is disruptive. Then maybe a splash screen between maps to announce to all players what the next map cvars are (in text form of course like "The next map is TDM style with rifles and nades") or similar.

    You wrote....
    while(getcvar(configdone) != "1"))
    waitframe

    Funny, I had written the identical lines in my config before seeing your post I was using waitframe as well, but if that didn't work was going to wait .4 or so.

    On the last item of inter process timing... I don't know enough about the engine architecture to say, but perhaps some primitive IPC mechanism and/or scheduler/priority mod would allow specific ordering of mod execs, with "thread this" or "exec and wait till done" type sequencing.

    I have a couple other questions but they are really not part of the thread subject so I'll start new ones. Thanks again for all the help and thoughts!

  8. #48
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Oooh i didnt think of per map basis... or even per gametype basis, that might be interesting to add to it.
    Ill also add the weapon swap to the cvar list so you can limit what weapons can be swapped by cvar aswell not just editing the array inside the weapons.scr

    Reborn has a gettime function which returns the time of the server, so you could use this to implement a maplist by time. I did a similar mod that picks a random maps on the server to add to the maplist every 24hours.

    MOHAA does kind of support that, it has the waitthread and waitexec which will wait until the script has executed before continuing, i am wondering if you could do a waitexec server.cfg from the commandline of the server executable....
    have to test that.
    I am sure someone here who has dug more into the way moha executes things might be able to help on that question, probably someone like Sor, Elgan or Leyok might have a greater understanding of these things.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Page 5 of 5 FirstFirst ... 345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •